namespace Maple.Branch.Identity.Entities
{
    using System;
    using Enums;
    using JetBrains.Annotations;
    using Volo.Abp;
    using Volo.Abp.Domain.Entities;

    public class IdentityClaimType : AggregateRoot<Guid>
    {
        public string Name { get; protected set; }

        public bool Required { get; set; }

        public bool IsStatic { get; protected set; }

        public string Regex { get; set; }

        public string RegexDescription { get; set; }

        public string Description { get; set; }

        public IdentityClaimValueTypeEnum ClaimType { get; protected set; }

        protected IdentityClaimType()
        {
        }

        public IdentityClaimType(
            Guid id,
            [NotNull] string name,
            bool required = false,
            bool isStatic = false,
            [CanBeNull] string regex = null,
            [CanBeNull] string regexDescription = null,
            [CanBeNull] string description = null,
            IdentityClaimValueTypeEnum claimType = IdentityClaimValueTypeEnum.String)
        {
            Id = id;
            Name = Check.NotNull(name, nameof(name));
            Required = required;
            IsStatic = isStatic;
            Regex = regex;
            RegexDescription = regexDescription;
            Description = description;
            ClaimType = claimType;
        }
    }
}
